10 REM DEMO OF READING A COMMAND LINE ARGUMENT FROM THE DISK TRANSFER AREA
20 GOSUB 3000:REM SET UP ASSEMBLY LANGUAGE ROUTINE
30 GOSUB 2000:REM CALL ROUTINE TO GET PROGRAM SEGMENT PREFIX ADDRESS
40 DTA$="":REM CLEAR THE STRING INITIALLY
50 DEF SEG=PSPADD:REM POINT TO PSP SEGMENT (NUMBER OF CHARACTERS IS AT &H80)
60 FOR A=&H81 TO &HFF:REM &H81 WILL USUALLY BE A SPACE
70 A$=CHR$(PEEK(A)):REM GET EACH CHARACTER
80 IF A$=CHR$(13) THEN 110:REM ALL COMMANDS SHOULD END WITH A CARRIAGE RETURN
90 DTA$=DTA$+A$:REM BUILD STRING
100 NEXT A:REM CONTINUE UNTIL CARRIAGE RETURN
110 DEF SEG:REM BACK TO BASIC'S SEGMENT
120 PRINT "COMMAND ARGUEMENT=";DTA$
130 END
1970 REM ********************************************************************
1980 REM ----------- SET UP AND CALL ASSEMBLY LANGUAGE SUBROUTINE -----------
1990 REM
2000 DEF SEG=&H4B                  :REM POINT TO SEGMENT OF SUBROUTINE
2010 ASMSUB=0:CALL ASMSUB          :REM THIS LINE FOR GWBASIC INTERPRETER
2020 REM CALL ABSOLUTE(0)          :REM THIS LINE FOR QUICKBASIC COMPILER
2030 PSPADD=(PEEK(4)*256)+PEEK(3)  :REM FORM PROGRAM SEGMENT PREFIX ADDRESS
2040 IF PSPADD>32767 THEN PSPADD=PSPADD-65536!:BEEP
2050 DEF SEG                       :REM RETURN TO BASIC SEGMENT
2060 RETURN
2070 REM
2830 REM ********************************************************************
2840 REM ---------------- LOAD ASSEMBLY LANGUAGE SUBROUTINE -----------------
2850 REM
2860 REM This routine loads a assembly language subroutine into the area
2870 REM just below the DOS inter-program communication area. 0000:04B0
2880 REM
2890 REM               CODE SEGMENT
2900 REM               ASSUME  CS:CODE
2910 REM               JMP     HERE            ;JUMP AROUND STORAGE AREA
2920 REM        TEMP   DW      0               ;STORAGE FOR REGISTERS-
2930 REM        HERE:  MOV	AH,62H          ;GET PSP ADDRESS FUNCTION
2940 REM        	INT	21H             ;DOS FUNCTION CALL INTERRUPT
2950 REM        	MOV	CS:TEMP,BX      ;STORE RETURNED VALUE
2960 REM               RETF                    ;FAR RETURN
2970 REM               CODE ENDS
2980 REM               END
2990 REM
3000 DEF SEG=&H4B:RESTORE 3040
3010 FOR I=0 TO 14:READ B:POKE I,B:NEXT I
3020 DEF SEG:RETURN
3030 REM -----
3040 DATA &HEB,&H03,&H90
3050 DATA &H00,&H00
3060 DATA &HB4,&H62
3070 DATA &HCD,&H21
3080 DATA &H2E,&H89,&H1E,&H03,&H00
3090 DATA &HCB
